<template>
<div class="tc-center fl">
    <rx-center-title-swiper :data="title">
    <ul class="clearfix uiTab9 j_uiTab9">
        <li :class="{'uiTab9-active':subIndex == index}" @click="subSwitch(index)" v-for="(item, index) of title" :key="index">{{item}}</li>
    </ul>
    </rx-center-title-swiper>
    <div id="j-tc-center-content">
        <!-- 状态 state -->
        <div class="uiTab8Con" v-if="subIndex == 0">
            <rx-state></rx-state>
        </div>
        <!-- 店 -->
        <div class="uiTab8Con" v-if="subIndex == 1">
            <rx-store></rx-store>
        </div>
        <!-- 基础 -->
        <div class="uiTab8Con" v-if="subIndex == 2">
            <rx-base></rx-base>
        </div>
        <!-- 施工现场-->
        <div class="uiTab8Con" v-if="subIndex == 3">
            <rx-scene></rx-scene>
        </div>
           <!-- 服务-->
        <div class="uiTab8Con" v-if="subIndex == 4">
            <rx-server></rx-server>
        </div>
          <!--评价-->
        <div class="uiTab8Con" v-if="subIndex == 5">
            <rx-evaluation></rx-evaluation>
        </div>
    </div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
// 注: 所有的大组件已 rx-xxx 命名, 不要使用此示例文件命名，可保留作为参考
import rxState from './state'
import rxStore from './store'
import rxScene from './scene'
import rxServer from './server'
import rxEvaluation from './evaluation'
import rxBase from './base'

export default {
    components: {
        rxBase,
        rxState,
        rxStore,
        rxScene,
        rxServer,
        rxEvaluation
    },
    data () {
        return {
            level: 0,
            title: ['状态', '店', '基础', '施工现场', '服务', '评价'],
            subIndex: 0
        }
    },
    computed: {
        ...mapGetters(['leftInfo'])
    },
    created () {
        // this.level = this.leftInfo.user_level + '级'
        // this.title[6] = this.level
    },
    methods: {
        subSwitch (index) {
            this.subIndex = index
            // 关闭弹窗
            this.$router.push(this.$route.matched[1].path)
        }
    }
}
</script>
